package com.mo.lib.utils.data

import android.util.Base64

/**
 * @ author：mo
 * @ data：2022/4/25:9:26
 * @ 功能：
 */

/** 字符Base64加密*/
@JvmOverloads
fun Base64Encode(str: String, flags: Int = Base64.DEFAULT) = Base64.encodeToString(str.toByteArray(charset("UTF-8")), flags)

/** 字符Base64解密*/
@JvmOverloads
fun Base64Decode(str: String, flags: Int = Base64.DEFAULT) = String(Base64.decode(str.toByteArray(charset("UTF-8")), flags))